package com.qf.dao;

import com.qf.pojo.Branch;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

public interface BranchDao {
    @Results(id = "BranchMap",value = {
            @Result(column = "bid",property = "bid"),
            @Result(column = "bname",property = "bname"),
            @Result(column = "pid",property = "pid"),
            @Result(column = "updatetime",property = "updatetime"),
            @Result(column = "bid",property = "taskplans",

                    many = @Many(select = "com.qf.dao.TaskPlanDao.findTaskPlansBybid",fetchType = FetchType.EAGER)
            )
    })

    @Select("select * from branch where pid = #{pid}")
    public List<Branch> findBypid(int pid);
}
